class Bug < ActiveRecord::Base
  validates_presence_of :summary
  validates_presence_of :description
  
	protected
  def validate
    errors.add(:project_id, "should be selected") unless project_id > 0.0
  end

  belongs_to :project
  belongs_to :user
  belongs_to :status, :class_name => "BugStatuses", :foreign_key => "status_id"
  has_many :comments
end
